/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-17 22:48:58
 * @LastEditTime: 2022-05-20 21:14:39
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
 */
import { TIMESTAMP, TOKEN_TIME_VALUE } from '../constant'

// 获取
export const getTimeStamp = () => {
  return localStorage.getItem(TIMESTAMP)
}

// 设置
export const setTimeStamp = () => {
  localStorage.setItem(TIMESTAMP, Date.now())
}
// 判断
export const isCheckTimeStamp = () => {
  const currentTime = Date.now()
  return currentTime - getTimeStamp() > TOKEN_TIME_VALUE
}
